<%@ page language="java" import="java.util.*" pageEncoding="utf8"%>
<%@ page import="com.taobao.wolfwolf.taobao.*" %>
<%@ page import="com.taobao.api.*" %>
<%@ page import="com.taobao.api.response.LogisticsTraceSearchResponse" %>
<%@ page import="com.taobao.api.request.LogisticsTraceSearchRequest" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%
	long tid = Long.valueOf(request.getParameter("tid"));

	TaobaoClient client = new DefaultTaobaoClient(TaoBaoUtil.TAOBAO_F_URL, TaoBaoUtil.APP_KEY, TaoBaoUtil.APP_SERCET, Constants.FORMAT_XML);
	LogisticsTraceSearchRequest req=new LogisticsTraceSearchRequest();
	req.setTid(tid);
	req.setSellerNick("myleft1");
	LogisticsTraceSearchResponse rep = client.execute(req);
	request.setAttribute("rep", rep.getBody());
%>

<html>
<script type="text/javascript" src="js/jquery-latest.js"></script>
<script type="text/javascript">
	$(document).ready(function () {
        $('body').keydown(function(event) {
	    	var keycode = event.which;
	    	if(keycode == 27) {
	    		window.close();
	    	}
	    });
	    
	    $("tr:last").css({color: '#F00'});	    
    });
</script>
<body>
	<h1 align='center'>快递追踪</h1>
	<table align='center'>
	
	<x:parse var='doc' xml='${rep}' />
	<tr>
		<td align='right'>
			快递公司名称:
		</td>
		<td><div style='margin-left: 10px'><x:out select="$doc//company_name" /></div></td>
	</tr>
	<tr>
		<td align='right'>运单号:</td>
		<td><div style='margin-left: 10px'><x:out select="$doc//out_sid" /></div></td>
	</tr>
	<tr>
		<td align='right'>订单号:</td>
		<td><div style='margin-left: 10px'><x:out select="$doc//tid" /></div></td>
	</tr>
	<tr>
		<td colspan='2'>&nbsp;</td>
	</tr>
	<x:forEach select="$doc//transit_step_info">
		<tr>
			<td align='center'>
				<x:out select="status_time" />
			</td>
			<td align='left'>
				<div style='margin-left: 10px'><x:out select="status_desc" /></div>
			</td>
		</tr>
	</x:forEach>
	</table>
</body>
</html>